import type { CarListData, CarParams, editCarRes, RuleDate, RuleDateParams } from "@/types/car"
import type { cardAddParam } from "@/types/car"
import { request } from "@/utils/reuqest"
export const carAPI=(data:CarParams)=>{
 return request<CarListData>('/parking/card/list','GET',data)
}
export const addCarAPI=(data:Partial<cardAddParam>)=>{
  return request('parking/card','POST',data)
}
export const editCarAPI=(id:string)=>{
  return request<editCarRes>(`/parking/card/detail/${id}`)
}
export const updateCarAPI=(data:Partial<editCarRes>)=>{
  return request('parking/card/edit','PUT',data)
}
export const deleteCarAPI=(ids:string[])=>{
  return request(`/parking/card/${ids.join(',')}`,'DELETE')
}
export const ruleDataGetAPI=(data:RuleDateParams)=>{
  return request<RuleDate>('/parking/rule/list','GET')
}
export const ruleDataDeleteAPI=(id:string)=>{
  return request(`/parking/rule/${id}`,'DELETE')
}